<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登陆人力资源管理系统!</title>
<link href="css/Default.css" rel="stylesheet" type="text/css">
<style>
#loginTable input.inputText {
	background: #292929;
}

#loginTable input:focus {
	background: #292929;
}
</style>
<script src="scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="scripts/HRM.js" type="text/javascript"></script>
<script>
$().ready(
			function() {
				if (window.top.location != window.self.location) {
					window.top.location = window.self.location;
				} else {
					$("#username").focus();
					//$("#username").val("admin");
					//$("#password").val("admin");
				}
				$("#loginImg").live(
						'click',
						function() {
							if ($("#username").val().trim() == ""
									|| $("#password").val().trim() == "") {
								alert("请输入用户名和密码!");
								return;
							}
							//登陆按钮变灰
							var path = "login.do?method=login&username=";
							path += $('#username').val().trim();
							path += "&password=";
							path += $('#password').val().trim();
							$.ajax({
								type : "GET",
								url : path,
								dataType : "json",
								success : function(data) {
									if (data['status'] == 'ERROR') {
										alert(data['msg']);
									} else {
										window.location.href = "index.jsp";
									}
								},
								error : function() {
									alert("登陆连接出错！");
								}
							});
						});
			});
</script>
</head>
<body style="background: #016AA9;">
	<form id="form1" method="post" style="display: block; height: 100%;">
		<table width="100%" height="100%">
			<tr>
				<td align="center" valign="middle">
					<div
						style="width: 1003px; height: 613px; background: url('./images/login.png');">
						<table id="loginTable" width="220px;" border="0" align="center"
							cellpadding="0" cellspacing="0" style="margin-top: 300px;margin-left: 400px;position:absolute;z-index:9999;">
							<tr>
								<td align="left">用户</td>
								<td><input name="username" type="text" style="width: 120px"
									id="username" class="inputText" style="background:#292929;" />
								</td>
								<td></td>
							</tr>
							<tr>
								<td style="height: 3px;"></td>
								<td></td>
								<td></td>
							</tr>
							<tr>
								<td align="left">密码</td>
								<td><input name="password" type="password"
									style="width: 120px" id="password" class="inputText" /></td>
								<td><img id="loginImg" style="cursor: pointer;"
									src="./images/loginBtn.png" /></td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
